<template>
  <div>
    <el-input v-model="val"></el-input>
    <el-button @click="createArr">创建数组</el-button>
    <el-input v-model="msg"></el-input>
    <lzc-select :val-from-parent="val" :list-from-parent="list" style="width: 200px"></lzc-select>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import lzcSelect from './virtual-index.vue'
interface ListItem {
  label: string
  value: string
}
const val = ref('')
const list = ref<ListItem[]>([])
const msg = ref('')
const createArr = () => {
  msg.value = '数组创建中...'
  list.value = []
  const len = Math.ceil(Math.random() * 1000000 + 1000000)
  for (let i = 0; i < len; i++) {
    list.value.push({
      label: 'label' + (i + 1),
      value: 'value' + (i + 1)
    })
  }
  msg.value = '数组创建完成，长度为' + len
}
</script>
<style lang="scss" scoped></style>
